package com.bc.trade.channel.transferqrcode;

import com.bc.common.CommonEnum.Resp;
import com.bc.common.message.DFReq;
import com.bc.common.message.DFResp;
import com.bc.common.message.TransferQrcodeReq;
import com.bc.common.message.TransferQrcodeResp;
import com.bc.trade.channel.IChannel;
import com.bc.trade.message.QueryCardInfoReq;
import com.bc.trade.message.QueryCardInfoResp;
import com.bc.trade.message.QueryOrderResp;
import com.bc.trade.message.QuickPayReq;
import com.bc.trade.message.QuickPayResp;
import com.bc.trade.message.QuickPaySetReq;
import com.bc.trade.message.QuickPaySetResp;
import com.bc.trade.message.RefundReq;
import com.bc.trade.message.RefundResp;
import com.bc.trade.message.SendSMSReq;
import com.bc.trade.message.SendSMSResp;
import com.bc.trade.message.UnionPayReq;
import com.bc.trade.message.UnionPayResp;
import com.bc.trade.model.TradeOrder;
import com.bc.trade.model.TransferQrcode;
import com.fs.common.util.FSLog;

public class TransferQrcodeChannel  implements IChannel {
	public TransferQrcodeResp transferQrcode(TransferQrcodeReq req, TradeOrder order) throws Exception {
		TransferQrcodeResp resp = new TransferQrcodeResp(req);
		resp.setOrderNo(order.getOrderNo());
		TransferQrcode transferQrcode = TransferQrcode.dao.selectQrcode(order.getAmount().toString());
		if (transferQrcode != null) {
			order.setChannelOrderNo(transferQrcode.getRemark());
			order.setBankCardNo(transferQrcode.getAliAccount());
			resp.setQrcodeUrl(transferQrcode.getQrcodeUrl());
			resp.setCodeAndMsg(Resp.Success.getCode(), Resp.Success.getMsg());
		} else {
			FSLog.api.info(order.getOrderNo() + "无转账二维码可用");
			resp.setQrcodeUrl("");
			resp.setCodeAndMsg(Resp.Fail.getCode(), Resp.Fail.getMsg());
		}
		return resp;
	}

	@Override
	public QueryOrderResp query(TradeOrder order) throws Exception {
		return null;
	}

	@Override
	public QueryOrderResp dfQuery(TradeOrder order) throws Exception {
		return null;
	}

	@Override
	public DFResp df(DFReq req, TradeOrder order) throws Exception {
		return null;
	}

	@Override
	public UnionPayResp unionpay(UnionPayReq req, TradeOrder order) throws Exception {
		return null;
	}

	@Override
	public QuickPaySetResp quickPaySet(QuickPaySetReq req, TradeOrder order) throws Exception {
		return null;
	}

	@Override
	public QuickPayResp quickPay(QuickPayReq req, TradeOrder order) throws Exception {
		return null;
	}

	@Override
	public SendSMSResp sendSMS(SendSMSReq req) throws Exception {
		return null;
	}

	@Override
	public QueryCardInfoResp queryCardInfo(QueryCardInfoReq req) throws Exception {
		return null;
	}

	@Override
	public RefundResp refund(RefundReq req, TradeOrder refundOrder, TradeOrder orignOrder) throws Exception {
		return null;
	}
}
